const express = require("express");
const router = express.Router();

const userController = require("../controllers/userController");

// 创建用户（注册）
router.post("/", (req, res) => {
  userController.createUser(req, res);
});

// 根据手机号查询用户（登录）
router.get("/find", (req, res) => {
  userController.getUserByPhone(req, res);
});

// 更新用户信息
router.put("/", (req, res) => {
  userController.updateUser(req, res);
});

// 获取所有用户
router.get("/", (req, res) => {
  userController.getAllUser(req, res);
});

// 删除用户信息
router.delete("/", (req, res) => {
  userController.deleteUser(req, res);
});

module.exports = router;
